package com.neusoft.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.neusoft.entity.Operator;
import com.neusoft.entity.OperatorExample;
import com.neusoft.mapper.OperatorMapper;
import com.neusoft.service.OperatorService;

@Service
public class OperatorServiceImpl implements OperatorService {

	@Autowired
	OperatorMapper operatorMapper;

	@Override
	@Transactional
	public int removeOperatorById(Integer oId) {
		return operatorMapper.deleteByPrimaryKey(oId);
	}

	@Override
	public int addOperatorSelective(Operator record) {
		return operatorMapper.insertSelective(record);
	}

	/*
	 * @Override public List<Operator> loadOperatorByExample(OperatorExample
	 * example) { return operatorMapper.selectByExample(example); }
	 */

	/////////////////////////// 对吗
	@Override
	public List<Operator> loadListByExample(String account, String password) {
		OperatorExample example = new OperatorExample();
		OperatorExample.Criteria uc = example.createCriteria();
		uc.andOAccountEqualTo(account);
		uc.andOPasswordEqualTo(password);
		return operatorMapper.selectByExample(example);
	}

	@Override
	public Operator loadOperatorById(Integer oId) {
		return operatorMapper.selectByPrimaryKey(oId);
	}

	@Override
	public int updateOperatorByIdSelective(Operator record) {
		return operatorMapper.updateByPrimaryKeySelective(record);
	}

	///////////////////////////////////////////////////////
	@Override
	public List<Operator> loadOperatorByExample(String account, String password) {
		// TODO Auto-generated method stub
		return null;
	}

}
